package com.digitalchina.lxnsy.activity.farmTrain;

import android.webkit.JavascriptInterface;

import com.digitalchina.lxnsy.base.BaseHtmlActivity;
import com.digitalchina.lxnsy.xml.UserXML;

/**
 * ================================================
 * 项目名称：android
 * 类描述：培训首页
 * 创建人：yzm
 * 创建时间：2020/1/8 17:26
 * 修改备注：
 * ================================================
 */
public class TrainIndexActivity extends BaseHtmlActivity {
    @Override
    protected void loadHtml() {
        webView.addJavascriptObject(new JsApi(), null);
        loadUrl("train-index");
        setTitle("培训需求");

        callJsMethod("setTel",new String[]{UserXML.getMobilePhone(activity)});
    }

    @Override
    public void rightOnClick() {

    }

    public class JsApi {

        //去完善需求
        @JavascriptInterface
        public void goImproveDemand(Object msg) {
            go(ImproveDemandActivity.class);
        }

        //对接成功案例详情
        @JavascriptInterface
        public void goTrainSuccessCaseDetail(Object msg) {
            go(SuccessCaseDetailActivity.class);
        }

        //成功对接案例列表
        @JavascriptInterface
        public void goSuccessCaseList(Object msg) {
            go(SuccessCaseListActivity.class);
        }

        //去机构信息维护-测试用
        @JavascriptInterface
        public void goOrgUpdate(Object msg) {
            go(TrainOrgUpdateActivity.class);
        }

        //去培训机构列表
        @JavascriptInterface
        public void goOrgList(Object msg) {
            go(TrainAgencyListActivity.class);
        }

        //去需求大厅
        @JavascriptInterface
        public void goDemandList(Object msg) {
            go(DemandListActivity.class);
        }
    }
}
